package com.xiaochong.tir.mq.rabbit;

import org.springframework.amqp.core.Binding;
import org.springframework.amqp.core.BindingBuilder;
import org.springframework.amqp.core.DirectExchange;
import org.springframework.amqp.core.Queue;
import org.springframework.beans.factory.annotation.Configurable;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * Created by admin on 2018/6/16.
 */
@Configurable
@Component
public class HuobiproQueenConfig {
    @Bean
    public DirectExchange HuobiproNodeAPIExchange() {
        return new DirectExchange(ExchangeQueue.Exchange.EX_NODE_API_MQ, true, false);
    }
    @Bean
    public Queue queueKDataHuobiproAction(){
        return new Queue(HuobiproMqQueue.QUEUE_DEPTH_HUOBIPRO, true);
    }
    @Bean
    public Binding bindingKDataHuobiproAction(){
        return BindingBuilder.bind(queueKDataHuobiproAction()).to(HuobiproNodeAPIExchange()).with(HuobiproMqQueue.QUEUE_DEPTH_HUOBIPRO);
    }

}
